<style lang="less">
    @import "configManage.less";
</style>
<template>
    <div>
        <Card title="分值设定">
            <Tabs v-model="tabName" :animated="false" style="overflow: visible">
                <TabPane label="学历分值" name="oss">
                    <div style="position:relative">
                        <Form ref="ossForm" :model="form" :label-width="150" label-position="right">
                          <!--  <FormItem label="学历分基数" prop="accessKey">
                                <Input type="number" v-model="form." placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>-->
                            <FormItem label="博士" prop="E_01">
                                <Input type="number" v-model="form.E_01" element-id="E_01" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="硕士" prop="E_02">
                                <Input type="number" v-model="form.E_02" element-id="E_02" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="985" prop="E_03">
                                <Input type="number" v-model="form.E_03" element-id="E_03" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="海外高校" prop="E_04">
                                <Input type="number" v-model="form.E_04" element-id="E_04" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="211高校" prop="E_05">
                                <Input type="number" v-model="form.E_05" element-id="E_05" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="一类本科" prop="E_06">
                                <Input type="number" v-model="form.E_06" element-id="E_06" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="其他本科机继续教育本科" prop="E_07">
                                <Input type="number" v-model="form.E_07" element-id="E_07" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="大专" prop="E_08">
                                <Input type="number" v-model="form.E_08" element-id="E_08" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="高中、高职" prop="E_09">
                                <Input type="number" v-model="form.E_09" element-id="E_09" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="初中、中专" prop="E_10">
                                <Input type="number" v-model="form.E_10" element-id="E_10" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                        </Form>
                        <Spin fix v-if="loading"></Spin>
                    </div>
                </TabPane>
                <TabPane label="专业类别分值" name="sms">
                    <div style="position:relative">
                        <Form ref="smsForm" :model="form" :label-width="110" label-position="right">
                          <!--  <FormItem label="专业分基数" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>-->
                            <FormItem label="物业管理" prop="PF_01">
                                <Input type="number" v-model="form.PF_01" element-id="PF_01" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="商科" prop="PF_02">
                                <Input type="number" v-model="form.PF_02" element-id="PF_02" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="管理学" prop="PF_03">
                                <Input type="number" v-model="form.PF_03" element-id="PF_03" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="其他专业" prop="PF_04">
                                <Input type="number" v-model="form.PF_04" element-id="PF_04" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                        </Form>
                        <Spin fix v-if="loading"></Spin>
                    </div>
                </TabPane>
              <!--  <TabPane label="企业排名分值" name="email">
                    <div style="position:relative">
                        <Form ref="emailForm" :model="form" :label-width="130" label-position="right">
                            <FormItem label="企业排名分基数" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="百强企业Top10" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="百强企业Top20-30" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="百强企业Top30-50" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="百强企业Top50-100" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="其他企业100名以外" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="非物业/房地产行业" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                        </Form>
                        <Spin fix v-if="loading"></Spin>
                    </div>
                </TabPane>-->
                <TabPane label="职位系数分值" name="vaptcha">
                    <div style="position:relative">
                        <Form ref="vaptchaForm" :model="form" :label-width="110" label-position="right">
                          <!--  <FormItem label="职位分基数" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>-->
                            <FormItem label="总经理" prop="P_01">
                                <Input type="number" v-model="form.P_01" element-id="P_01"  @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="副总经理" prop="P_02">
                                <Input type="number" v-model="form.P_02" element-id="P_02" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="大区总监" prop="P_03">
                                <Input type="number" v-model="form.P_03" element-id="P_03" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="专业总监" prop="P_04">
                                <Input type="number" v-model="form.P_04" element-id="P_04" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="项目经理" prop="P_05">
                                <Input type="number" v-model="form.P_05" element-id="P_05" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="专业经理" prop="P_06">
                                <Input type="number" v-model="form.P_06" element-id="P_06" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="管家" prop="P_07">
                                <Input type="number" v-model="form.P_07" element-id="P_07" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="专业文员" prop="P_08">
                                <Input type="number" v-model="form.P_08" element-id="P_08" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="基层员工" prop="P_09">
                                <Input type="number" v-model="form.P_09" element-id="P_09" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                        </Form>
                        <Spin fix v-if="loading"></Spin>
                    </div>
                </TabPane>
                <TabPane label="工作年限分值" name="other">
                    <div style="position:relative">
                        <Form ref="otherForm" :model="form" :label-width="110" label-position="right">
                           <!-- <FormItem label="工作分基数" prop="accessKey">
                                <Input type="number" v-model="sms.accessKey" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>-->
                            <FormItem label="15年以上" prop="WY_01">
                                <Input type="number" v-model="form.WY_01"  element-id="WY_01" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="8-15年" prop="WY_02">
                                <Input type="number" v-model="form.WY_02" element-id="WY_02" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="3-8年" prop="WY_03">
                                <Input type="number" v-model="form.WY_03" element-id="WY_03" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                            <FormItem label="3年以下" prop="WY_04">
                                <Input type="number" v-model="form.WY_04" element-id="WY_04" @on-change="enumOnchange" placeholder="请输入分值" style="width: 350px"/>
                            </FormItem>
                        </Form>
                        <Spin fix v-if="loading"></Spin>
                    </div>
                </TabPane>
            </Tabs>
        </Card>
    </div>
</template>

<script>
    import {
        getEnumData,updateEnums
    } from "@/api/index";
    export default {
        name: "config-manage",
        data() {
            return {
                tabName: "oss",
                loading: false, // 表单加载状态
                saveLoading: false,
                form:{
                    E_01:0,
                    E_02:0,
                    E_03:0,
                    E_04:0,
                    E_05:0,
                    E_06:0,
                    E_07:0,
                    E_08:0,
                    E_09:0,
                    E_10:0,
                    PF_01:0,
                    PF_02:0,
                    PF_03:0,
                    PF_04:0,
                    P_01:0,
                    P_02:0,
                    P_03:0,
                    P_04:0,
                    P_05:0,
                    P_06:0,
                    P_07:0,
                    P_08:0,
                    P_09:0,
                    WY_01:0,
                    WY_02:0,
                    WY_03:0,
                    WY_04:0
                },
                endpointPH: "请输入空间访问域名",
                dictBucketRegions: []
            };
        },
        methods: {
            init() {
                this.getData();
            },
            enumOnchange(event){
                var enumCode=event.target.id;
                var score=event.target.value;
                let params = {
                    enumCode,score
                }
                updateEnums(params).then(res => {
                    if (res.status === true) {
                        this.$Message.success(res.info);
                    }
                });
            },
            getData() {
                this.loading = true;
                getEnumData().then(res => {
                    this.loading = false;
                    if (res.status === true) {
                        this.form = res.data;
                    }
                });
            }

        },
        mounted() {
            this.init();
        }
    };
</script>